package net.csdra.libraryborrowing.service.book;

import net.csdra.libraryborrowing.domain.book.BookOrder;
import net.csdra.libraryborrowing.service.user.CurrentUserInfo;
import net.csdra.libraryborrowing.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.nio.file.AccessDeniedException;

/**
 * Created by msf on 2017/10/16.
 */
public class BookOrderServiceImpl implements BookOrderService {

    @Autowired
    CurrentUserInfo currentUserInfo;

    @Override
    @Transactional
    public BookOrder createBookOrder(CreateBookOrder createBookOrder) throws AccessDeniedException {
        BookOrder bookOrder = Utils.createAutoSet(BookOrder.class, currentUserInfo.get().getUserName());
        Utils.copy(createBookOrder, bookOrder);

        return null;
    }

    @Override
    public BookOrder acceptBookOrder(AcceptBookOrder acceptBookOrder) {
        return null;
    }

    @Override
    public BookOrder rejectBookOrder(RejectBookOrder rejectBookOrder) {
        return null;
    }

    @Override
    public BookOrder remandBookCopy(RemandBookCopy handleRemandBookCopy) {
        return null;
    }
}
